package cn.itcast.tanhua.mytanhuaserver.service.impl;

import cn.itcast.tanhua.mytanhuadubbointerface.api.CheckApi;
import cn.itcast.tanhua.mytanhuadubbointerface.api.QuanziApi;
import cn.itcast.tanhua.mytanhuaserver.service.CheckService;
import cn.itcast.tanhua.pojo.Publish;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Service;



/**
 * @author 陈功炳
 * @since 2021/12/9 16:00
 */
@Service
public class CheckServiceImpl implements CheckService {
    @Reference
    private CheckApi checkApi;

    @Reference
    private QuanziApi quanziApi;

    /**
     * 查询用户需要审核的动态
     * @return
     */
    @Override
    public String check(String publishId,String checkResult) {

        //根据审核中的publishId查询表数据
        Publish publish = quanziApi.queryPublishById(publishId);
        Long pid = publish.getPid();
        //返回审核结构
        return checkApi.check(String.valueOf(pid), checkResult);
    }
}
